import React from "react";
import src from "@/assets/images/user/choice_me.png";
import "./choiceitem.less";

interface IProps {
  data: ISelectOption;
  isCheck: boolean;
  onCheck: (val:string) => void;
}

export default function ChoiceItem({ data, isCheck,onCheck }: IProps) {
  return (
    <div className="choice-item" onClick={()=>{onCheck(data.key)}}>
      <div className="check">
        <img src={src} alt="" style={{ display: isCheck ? "block" : "none" }} />
      </div>
      <div className="opt">{data.key}</div>
      <div className="content">{data.value}</div>
    </div>
  );
}
